Skip to content

[16.0][ADD] check_current_company_for_validation module #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Kev-Roche
Copy link

Small mixin checkin if the current company is the same as the record company.
It's come with the check on sale.order

@Kev-Roche Kev-Roche changed the title [16.0][ADD] check_current_company_for_validation [16.0][ADD] check_current_company_for_validation module Sep 25, 2024
_description = "Check Current Company Mixin"

def check_current_company(self):
if self.env.company != self.company_id:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can fail if you have a recordset with different companies

Suggested change
if self.env.company != self.company_id:
if self.filtered(lambda x: x.company_id != self.env.company)

or loop through all the recordset

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 16, 2025
@github-actions github-actions bot closed this Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants